//
//  CMDQueryStringSerialization.h
//  CMDQueryStringSerialization
//
//  Created by Caleb Davenport on 1/21/14.
//  Copyright (c) 2014 Caleb Davenport. All rights reserved.
//

#if defined(__has_feature) && __has_feature(modules)
    @import Foundation;
#else
    #import <Foundation/Foundation.h>
#endif
#import <CMDQueryStringSerialization/CMDQueryStringWritingOptions.h>
#import <CMDQueryStringSerialization/NSURL+CMDQueryStringSerialization.h>

//! Project version number for Everest.
FOUNDATION_EXPORT double CMDQueryStringSerializationVersionNumber;

//! Project version string for GradientView.
FOUNDATION_EXPORT const unsigned char CMDQueryStringSerializationVersionString[];

/**
 Easily convert between query strings and dictionaries.
 */
@interface CMDQueryStringSerialization : NSObject

/**
 Read a query string into a dictionary.
 
 @param string Query string to be deserialized.
 @param options Serialization options.
 
 @return A dictionary.
 */
+ (NSDictionary *)dictionaryWithQueryString:(NSString *)string;

/**
 Serialize a dictionary into a query string. This is equivalent to calling
 `queryStringWithDictionary:options:` with
 `CMDQueryStringWritingOptionArrayRepeatKeys`
 and `CMDQueryStringWritingOptionDateAsUnixTimestamp`.
 
 @param dictionary Dictionary to be serialized.
 
 @return A query string.
 */
+ (NSString *)queryStringWithDictionary:(NSDictionary *)dictionary;

/**
 Serialize a dictionary into a query string.
 
 @param dictionary Dictionary to be serialized.
 @param options Serialization options.
 
 @return A query string.
 
 @see queryStringWithDictionary:
 */
+ (NSString *)queryStringWithDictionary:(NSDictionary *)dictionary options:(CMDQueryStringWritingOptions)options;

@end

